package org.wendu.wdoa.common;

public enum LeaveStatusEnum {

    TO_SUBMIT(0,"待提交"),
    TO_EXAMINE(1,"待审批"),
    REJECTED(2,"已驳回"),
    PASS(3,"已通过"),
    BACK(4,"已销假");

    private Integer code;
    private String name;

    private LeaveStatusEnum(Integer code,String name){
        this.code = code;
        this.name = name;
    }
    public static String getName(Integer code){
        LeaveStatusEnum[] statusEnums = LeaveStatusEnum.values();
        for(LeaveStatusEnum statusEnum : statusEnums){
            if (statusEnum.code.equals(code)) {
                return statusEnum.name;
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public Integer getCode() {
        return code;
    }
}
